# $Id$
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Yue

pkgname=libetonyek
pkgver=0.1.6
pkgrel=2
pkgdesc='Library and a set of tools for reading and converting Apple Keynote presentations'
arch=('i686' 'x86_64')
url="https://wiki.documentfoundation.org/DLP/Libraries/libetonyek"
license=('MPL')
depends=('libxml2' 'zlib' 'libwpd' 'boost-libs' 'librevenge' 'liblangtag')
makedepends=('boost' 'cppunit' 'gperf' 'doxygen' 'glm' 'mdds')
source=(https://dev-www.libreoffice.org/src/$pkgname/$pkgname-$pkgver.tar.xz
        0001-Allow-building-with-mdds-1.2.patch
        0001-drop-test-that-violates-Unicode-tr-35.patch
        0001-fix-test-on-i686.patch)
sha256sums=('df54271492070fbcc6aad9f81ca89658b25dd106cc4ab6b04b067b7a43dcc078'
            '0cbf1077123a75de9373f80bdec485438683f9954c45f39aaddec94750ef48b8'
            'dcd1750e6878c0b49fdcbbdabe1f0f58e27b02a9b4544ad7a1c979fc8707ab14'
            '9222ce04ce5a1a153d0bb0ac734b65bbad7a26767847c4195e545ca00cec34d2')

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../0001-Allow-building-with-mdds-1.2.patch
  patch -Np1 -i ../0001-drop-test-that-violates-Unicode-tr-35.patch
  patch -Np1 -i ../0001-fix-test-on-i686.patch
  autoreconf -vfi
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --with-mdds=1.2
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
